<%@page import="java.util.ArrayList"%>
<%@page import="com.situ.web.entity.Banji"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="bootstrap-3.3.7-dist/css/bootstrap.css"/>
<style type="text/css">
	.right{
		float: right;
		height: 40px;
		
	}
</style>
</head>
<body>
	<div style="width: 600px; margin: 100px auto;">
		<a href="/Java202007Web/banji_insert.jsp" class="btn btn-default btn-lg active right" role="button">添加</a>
		<table class="table table-hover table-bordered">
		<tr  class="warning">
			<td>banji_id</td>
			<td>course_id</td>
			<td>修改</td>
			<td>删除</td>
		</tr>
		<% // 这里可以嵌套java代码
			// request是jsp页面的内置对象，我们可以直接使用
			// req.setAttribute("list", list);
			// 从request里面拿出list数据
			List<Banji> list = (ArrayList<Banji>)request.getAttribute("list");
			for	 (Banji banji :list) {
				// 每遍历一个student就在table中打印一行数据tr
		%>
			<tr>
				<td><%=banji.getId()%></td>
				<td><%=banji.getName()%></td>
				<td><a href="/Java202007Web/banji?method=selectId&id=<%=banji.getId()%>">修改</a></td>
				<td><a href="/Java202007Web/banji?method=delete&id=<%=banji.getId()%>">删除</a></td>
			</tr>
		<%
			}
		%>
	</div>
	

</body>
</html>